package org.third.integration.ssh;

import com.jcabi.ssh.Shell;
import com.jcabi.ssh.SshByPassword;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.third.common.utils.CheckNodeResult;

public class JcabiJSchSshTest {
	private final static Logger logger = LoggerFactory.getLogger(JcabiJSchSshTest.class);

	public static void main(String[] args) {
		JcabiJSchSshTest tester = new JcabiJSchSshTest();
		tester.executeCommandOnRemote("dynasecurw1.hpeswlab.net", "root", "iso*help", "date; hostname -f; date;dax");
	}

	public static CheckNodeResult executeCommandOnRemote(String hostname, String username, String password,
			String cmd) {
		Shell shell;
		try {
			
			shell = new SshByPassword(hostname, 22, username, password);
			String stdout = new Shell.Plain(shell).exec(cmd);

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;
	}
}
